package com.oms.app.order.service.impl;

import java.util.List;
import java.util.Map;

import javax.servlet.http.HttpServletRequest;

import com.oms.app.order.dao.IOrderDAO;
import com.oms.app.order.model.Order;
import com.oms.app.order.service.IOrderService;
import com.oms.core.service.impl.GeneralService;

/**
 * @author Loong_Mit
 * @date Sep 1, 2012 7:03:38 PM
 */

public class OrderServiceImpl extends GeneralService<Order, String> implements IOrderService {

	@Override
	public List<Order> getOrderList(HttpServletRequest request) {
		return ((IOrderDAO) dao).getOrderList(request);
	}
	
	@Override
	public boolean auditOrder(String orderIds, String status) {
		return ((IOrderDAO) dao).auditOrder(orderIds, status);
	}
	
	@Override
	public boolean deleteOrder(String PK) {
		((IOrderDAO) dao).delDetailsByOrderId(PK);
		return ((IOrderDAO) dao).deleteOrder(PK);
	}
	
	@Override
	public List<Map<String, Object>> getOrderDetailList(String orderId) {
		return ((IOrderDAO) dao).getOrderDetailList(orderId);
	}
	
	@Override
	public boolean changeDetailStatus(String detailId, String status) {
		return ((IOrderDAO) dao).changeDetailStatus(detailId, status);
	}
	
	@Override
	public boolean delDetailsByOrderId(String orderId) {
		return ((IOrderDAO) dao).delDetailsByOrderId(orderId);
	}
	
	@Override
	public boolean delOrderDetailsByPK(String PK) {
		return ((IOrderDAO) dao).delOrderDetailsByPK(PK);
	}
}